home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part2 / 17563 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  2.1 KB

  1. Path: news.mindlink.net!news
  2. From: genew@mindlink.bc.ca (Gene Wirchenko)
  3. Newsgroups: comp.lang.c++,rec.games.programmer,alt.msdos.programmer,comp.programming
  4. Subject: Re: Young programmers read me.
  5. Date: Tue, 16 Apr 1996 14:49:32 GMT
  6. Organization: MIND LINK! - British Columbia, Canada
  7. Message-ID: <4l0c8p$rvp@fountain.mindlink.net>
  8. References: <4icpp9$7hr@barad-dur.nas.com> <4keejc$lpi@tpd.dsccc.com> <Pine.OSF.3.91.960411093444.20958D-100000@bud.cc.swin.edu.au> <4kmfqn$e0f@airdmhor.gen.nz> <4kubt3$2jk@plains.nodak.edu>
  9. NNTP-Posting-Host: line147.nwm.mindlink.net
  10. X-Newsreader: Forte Free Agent 1.0.82
  11.  
  12. hennebry@plains.nodak.edu (Michael J. Hennebry) wrote:
  13.  
  14. >In article <4kmfqn$e0f@airdmhor.gen.nz>,
  15. >Simon Hosie <gumboot@airdmhor.gen.nz> wrote:
  16. >>    if(something_happened)
  17. >>        do_something_else();
  18.  
  19. >AAAaaarrrggg! This is an accident waiting to happen. Here is Simon's
  20. >code after its next update:
  21.  
  22.      Why?  If you don't know the language, why program in it?
  23.      I always indent my code properly (meaning consistently) and if I
  24. saw that the then clause needed to be "blockized", I'd do it
  25. automatically.  No, it isn't.  It's:
  26.  
  27. >       if(something_happened)
  28.             {
  29. >           do_something_else();
  30. >           do_yet_another_thing();
  31.             }
  32.  
  33. >Lotsa luck.
  34.  
  35.      I don't need luck.  I have a method.
  36.  
  37. >Try this:
  38. >       if(something_happened) do_something_else();
  39.  
  40.      Not as clear as it should be by my standards.  YMMV.
  41.  
  42. >or this:
  43. >       if(something_happened)
  44. >       {   do_something_else(); }
  45.  
  46.      Extraneous braces cause pause.
  47.  
  48. >or even this:
  49. >       if(something_happened) { do_something_else(); }
  50.  
  51.      Ditto.
  52.  
  53. >Some of the airier suggestions in this thread remind me of the
  54. >style in Oh! Pascal:
  55.  
  56. >       if(something_happened)
  57. >          then
  58. >              begin
  59. >                  do_something_else();
  60. >              end
  61.  
  62. >-- 
  63. >Mike   hennebry@plains.NoDak.edu
  64. >Ivanova recommends not getting in front of Delenn.
  65.  
  66. Sincerely,
  67.  
  68. Gene Wirchenko
  69.  
  70. C Pronunciation Guide:
  71.      y=x++;     "wye equals ex plus plus semicolon"
  72.      x=x++;     "ex equals ex doublecross semicolon"
  73.  
  74.